home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text;
-
- import javax.swing.undo.AbstractUndoableEdit;
- import javax.swing.undo.CannotRedoException;
- import javax.swing.undo.CannotUndoException;
-
- public class DefaultStyledDocument$AttributeUndoableEdit extends AbstractUndoableEdit {
- protected AttributeSet newAttributes;
- protected AttributeSet copy;
- protected boolean isReplacing;
- protected Element element;
-
- public DefaultStyledDocument$AttributeUndoableEdit(Element var1, AttributeSet var2, boolean var3) {
- this.element = var1;
- this.newAttributes = var2;
- this.isReplacing = var3;
- this.copy = var1.getAttributes().copyAttributes();
- }
-
- public void redo() throws CannotRedoException {
- super.redo();
- MutableAttributeSet var1 = (MutableAttributeSet)this.element.getAttributes();
- if (this.isReplacing) {
- var1.removeAttributes(var1);
- }
-
- var1.addAttributes(this.newAttributes);
- }
-
- public void undo() throws CannotUndoException {
- super.undo();
- MutableAttributeSet var1 = (MutableAttributeSet)this.element.getAttributes();
- var1.removeAttributes(var1);
- var1.addAttributes(this.copy);
- }
- }
-